﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using EasyGrocer.BusinessLayer.ServiceRepository;
using EasyGrocer.DataLayer;

namespace EasyGrocer.UI
{
    public partial class SearchBox : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            ICategoryServiceRep cRep = BusinessServiceFactory.CreateCategoryService();
            
            List<Category> categorieses = cRep.GetRootChildren().ToList();
            Category c = new Category {ID = Guid.NewGuid(), Name = "All"};
            categorieses.Add(c);
            CategoryDropDown.DataSource = categorieses.OrderBy(a=>a.Name);
            CategoryDropDown.DataBind();

        }

        protected void Button5_Click(object sender, EventArgs e)
        {
        }

    }
}